# coding: utf-8

import six

from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization


class VulnerabilityPatch:

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    sensitive_list = []

    openapi_types = {
        'patch_id': 'str',
        'patch_name': 'str',
        'type': 'str',
        'major_level': 'str',
        'status': 'str',
        'repair_cmd': 'str',
        'repair_necessity': 'str',
        'release_time': 'datetime',
        'reference_url': 'str',
        'vendor_name': 'str',
        'vulnerable_package': 'str',
        'cve_ids': 'str'
    }

    attribute_map = {
        'patch_id': 'patch_id',
        'patch_name': 'patch_name',
        'type': 'type',
        'major_level': 'major_level',
        'status': 'status',
        'repair_cmd': 'repair_cmd',
        'repair_necessity': 'repair_necessity',
        'release_time': 'release_time',
        'reference_url': 'reference_url',
        'vendor_name': 'vendor_name',
        'vulnerable_package': 'vulnerable_package',
        'cve_ids': 'cve_ids'
    }

    def __init__(self, patch_id=None, patch_name=None, type=None, major_level=None, status=None, repair_cmd=None, repair_necessity=None, release_time=None, reference_url=None, vendor_name=None, vulnerable_package=None, cve_ids=None):
        """VulnerabilityPatch

        The model defined in huaweicloud sdk

        :param patch_id: 补丁编号。
        :type patch_id: str
        :param patch_name: 补丁名称。
        :type patch_name: str
        :param type: 补丁类型（0：linux，1：windows，2：web-cms）。
        :type type: str
        :param major_level: 重要等级。
        :type major_level: str
        :param status: 补丁状态。
        :type status: str
        :param repair_cmd: 修复命令。
        :type repair_cmd: str
        :param repair_necessity: 修复必要程度（1：需立刻修复，2：可延后修复，3：暂可以不修复）。
        :type repair_necessity: str
        :param release_time: 发布时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息       为事件发生时区，无法解析时区的时间，默认时区填东八区。
        :type release_time: datetime
        :param reference_url: 参考链接。
        :type reference_url: str
        :param vendor_name: 漏洞报告提供者信息。
        :type vendor_name: str
        :param vulnerable_package: 受影响软件版本。
        :type vulnerable_package: str
        :param cve_ids: CVE编号列表。
        :type cve_ids: str
        """
        
        

        self._patch_id = None
        self._patch_name = None
        self._type = None
        self._major_level = None
        self._status = None
        self._repair_cmd = None
        self._repair_necessity = None
        self._release_time = None
        self._reference_url = None
        self._vendor_name = None
        self._vulnerable_package = None
        self._cve_ids = None
        self.discriminator = None

        self.patch_id = patch_id
        if patch_name is not None:
            self.patch_name = patch_name
        if type is not None:
            self.type = type
        if major_level is not None:
            self.major_level = major_level
        if status is not None:
            self.status = status
        if repair_cmd is not None:
            self.repair_cmd = repair_cmd
        if repair_necessity is not None:
            self.repair_necessity = repair_necessity
        if release_time is not None:
            self.release_time = release_time
        if reference_url is not None:
            self.reference_url = reference_url
        if vendor_name is not None:
            self.vendor_name = vendor_name
        if vulnerable_package is not None:
            self.vulnerable_package = vulnerable_package
        if cve_ids is not None:
            self.cve_ids = cve_ids

    @property
    def patch_id(self):
        """Gets the patch_id of this VulnerabilityPatch.

        补丁编号。

        :return: The patch_id of this VulnerabilityPatch.
        :rtype: str
        """
        return self._patch_id

    @patch_id.setter
    def patch_id(self, patch_id):
        """Sets the patch_id of this VulnerabilityPatch.

        补丁编号。

        :param patch_id: The patch_id of this VulnerabilityPatch.
        :type patch_id: str
        """
        self._patch_id = patch_id

    @property
    def patch_name(self):
        """Gets the patch_name of this VulnerabilityPatch.

        补丁名称。

        :return: The patch_name of this VulnerabilityPatch.
        :rtype: str
        """
        return self._patch_name

    @patch_name.setter
    def patch_name(self, patch_name):
        """Sets the patch_name of this VulnerabilityPatch.

        补丁名称。

        :param patch_name: The patch_name of this VulnerabilityPatch.
        :type patch_name: str
        """
        self._patch_name = patch_name

    @property
    def type(self):
        """Gets the type of this VulnerabilityPatch.

        补丁类型（0：linux，1：windows，2：web-cms）。

        :return: The type of this VulnerabilityPatch.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this VulnerabilityPatch.

        补丁类型（0：linux，1：windows，2：web-cms）。

        :param type: The type of this VulnerabilityPatch.
        :type type: str
        """
        self._type = type

    @property
    def major_level(self):
        """Gets the major_level of this VulnerabilityPatch.

        重要等级。

        :return: The major_level of this VulnerabilityPatch.
        :rtype: str
        """
        return self._major_level

    @major_level.setter
    def major_level(self, major_level):
        """Sets the major_level of this VulnerabilityPatch.

        重要等级。

        :param major_level: The major_level of this VulnerabilityPatch.
        :type major_level: str
        """
        self._major_level = major_level

    @property
    def status(self):
        """Gets the status of this VulnerabilityPatch.

        补丁状态。

        :return: The status of this VulnerabilityPatch.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this VulnerabilityPatch.

        补丁状态。

        :param status: The status of this VulnerabilityPatch.
        :type status: str
        """
        self._status = status

    @property
    def repair_cmd(self):
        """Gets the repair_cmd of this VulnerabilityPatch.

        修复命令。

        :return: The repair_cmd of this VulnerabilityPatch.
        :rtype: str
        """
        return self._repair_cmd

    @repair_cmd.setter
    def repair_cmd(self, repair_cmd):
        """Sets the repair_cmd of this VulnerabilityPatch.

        修复命令。

        :param repair_cmd: The repair_cmd of this VulnerabilityPatch.
        :type repair_cmd: str
        """
        self._repair_cmd = repair_cmd

    @property
    def repair_necessity(self):
        """Gets the repair_necessity of this VulnerabilityPatch.

        修复必要程度（1：需立刻修复，2：可延后修复，3：暂可以不修复）。

        :return: The repair_necessity of this VulnerabilityPatch.
        :rtype: str
        """
        return self._repair_necessity

    @repair_necessity.setter
    def repair_necessity(self, repair_necessity):
        """Sets the repair_necessity of this VulnerabilityPatch.

        修复必要程度（1：需立刻修复，2：可延后修复，3：暂可以不修复）。

        :param repair_necessity: The repair_necessity of this VulnerabilityPatch.
        :type repair_necessity: str
        """
        self._repair_necessity = repair_necessity

    @property
    def release_time(self):
        """Gets the release_time of this VulnerabilityPatch.

        发布时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息       为事件发生时区，无法解析时区的时间，默认时区填东八区。

        :return: The release_time of this VulnerabilityPatch.
        :rtype: datetime
        """
        return self._release_time

    @release_time.setter
    def release_time(self, release_time):
        """Sets the release_time of this VulnerabilityPatch.

        发布时间，格式ISO8601：YYYY-MM-DDTHH:mm:ss.ms+timezone。时区信息       为事件发生时区，无法解析时区的时间，默认时区填东八区。

        :param release_time: The release_time of this VulnerabilityPatch.
        :type release_time: datetime
        """
        self._release_time = release_time

    @property
    def reference_url(self):
        """Gets the reference_url of this VulnerabilityPatch.

        参考链接。

        :return: The reference_url of this VulnerabilityPatch.
        :rtype: str
        """
        return self._reference_url

    @reference_url.setter
    def reference_url(self, reference_url):
        """Sets the reference_url of this VulnerabilityPatch.

        参考链接。

        :param reference_url: The reference_url of this VulnerabilityPatch.
        :type reference_url: str
        """
        self._reference_url = reference_url

    @property
    def vendor_name(self):
        """Gets the vendor_name of this VulnerabilityPatch.

        漏洞报告提供者信息。

        :return: The vendor_name of this VulnerabilityPatch.
        :rtype: str
        """
        return self._vendor_name

    @vendor_name.setter
    def vendor_name(self, vendor_name):
        """Sets the vendor_name of this VulnerabilityPatch.

        漏洞报告提供者信息。

        :param vendor_name: The vendor_name of this VulnerabilityPatch.
        :type vendor_name: str
        """
        self._vendor_name = vendor_name

    @property
    def vulnerable_package(self):
        """Gets the vulnerable_package of this VulnerabilityPatch.

        受影响软件版本。

        :return: The vulnerable_package of this VulnerabilityPatch.
        :rtype: str
        """
        return self._vulnerable_package

    @vulnerable_package.setter
    def vulnerable_package(self, vulnerable_package):
        """Sets the vulnerable_package of this VulnerabilityPatch.

        受影响软件版本。

        :param vulnerable_package: The vulnerable_package of this VulnerabilityPatch.
        :type vulnerable_package: str
        """
        self._vulnerable_package = vulnerable_package

    @property
    def cve_ids(self):
        """Gets the cve_ids of this VulnerabilityPatch.

        CVE编号列表。

        :return: The cve_ids of this VulnerabilityPatch.
        :rtype: str
        """
        return self._cve_ids

    @cve_ids.setter
    def cve_ids(self, cve_ids):
        """Sets the cve_ids of this VulnerabilityPatch.

        CVE编号列表。

        :param cve_ids: The cve_ids of this VulnerabilityPatch.
        :type cve_ids: str
        """
        self._cve_ids = cve_ids

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                if attr in self.sensitive_list:
                    result[attr] = "****"
                else:
                    result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        import simplejson as json
        if six.PY2:
            import sys
            reload(sys)
            sys.setdefaultencoding("utf-8")
        return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)

    def __repr__(self):
        """For `print`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, VulnerabilityPatch):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
